package collectionUnSafe.map;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public class MapTestSafe1 {
    public static void main(String[] args) {
        //初始容量16 加载因子0.75
        //Map<String,Object> map = new HashMap<>(16,0.75);

        Map<String,String> map = new ConcurrentHashMap<>();
        for (int i = 0 ; i < 30 ; i++){
            new Thread(()->{
                map.put(Thread.currentThread().getName(), UUID.randomUUID().toString().substring(0,5));
                System.out.println(map);
            },String.valueOf(i)).start();
        }
    }
}
